package co.edu.unal.research.contentprovider.extensions

import com.google.inject.Inject
import org.eclipse.xtext.naming.IQualifiedNameProvider
import co.edu.unal.research.contentprovider.contentProviderDsl.Table
import co.edu.unal.research.contentprovider.contentProviderDsl.TableColumn
import co.edu.unal.research.contentprovider.util.Constants

class TableExtensions {
	
	@Inject extension IQualifiedNameProvider
	
	def String getTableNameConstant(Table table){
		"TABLE_"+table.name
	}
	
	def String getColumnNameConstant(TableColumn tableColumn){
		"COLUMN_"+tableColumn.name
	}
	
	def String getColumnAdditionalFeatures(TableColumn tableColumn){
		
		var featuresFinal = "" as String
		
		for(feature : tableColumn.additionalFeatures){
			featuresFinal = featuresFinal + " " + feature
		}
		
		featuresFinal + " ,"
	}
	
	
	
}